/*
 * @Description: this
 * @Author: rendc
 * @Date: 2022-09-27 11:42:42
 * @LastEditors: rendc
 * @LastEditTime: 2022-09-27 11:55:14
 */
var add = function () {
  console.log(this);
}
// add();

let person = {
  name: "larry",
  age: 50,
  sayName: function () {
    console.log(this.name);
    console.log(arguments);
    // this -> person对象
  }
}
person.sayName();
let person2 = {
  name: "terry",
  age: 49,
  sayName: function () {
    console.log(arguments);
    console.log(this.name);
    // this -> person2对象
  }
}
person2.sayName();
// 改变this指向
person2.sayName.call(person, 1, 2, 3);
person2.sayName.apply(person, [1, 2, 3]);
console.log(1);
person2.sayName.bind(person, 9, 2, 3)();
console.log(2);


